package br.odonto.entities;

import java.util.Collection;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.ForeignKey;

@ManagedBean(name="estadoCivil")
@RequestScoped
@Entity
@Table(name="estadocivil")
public class EstadoCivil {
	@Id
	@GeneratedValue
	private int id;
	@Column
	private String descricao;
	@OneToMany
	@ForeignKey(name="FK_pessoa_civil")
	@JoinColumn(name="estado_civil")
	private Collection<Pessoa> pessoa;
	
	public EstadoCivil() {
		// TODO Auto-generated constructor stub
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}
	
	

}
